package com.example.dryclean_admin.controller;


import com.example.dryclean_admin.common.Result;
import com.example.dryclean_admin.entity.Menu;
import com.example.dryclean_admin.entity.User;
import com.example.dryclean_admin.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lijiaxin
 * @since 2023-12-25
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    public IMenuService iMenuService;
    @RequestMapping("/menulist")
    public Result Menulist(){
        return Result.success(iMenuService.list());
    }
    @RequestMapping("/list")
    public Result List(@RequestParam String roleid){
        List list = iMenuService.lambdaQuery().like(Menu::getMenuRight,roleid).list();
        return Result.success(list);
    }

}
